package com.card.server.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.card.server.model.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UsersMapper extends BaseMapper<Users> {

    @Select("SELECT * FROM users WHERE account = #{account}")
    Users selectByAccount(String account);

    @Select("select max(id) from users")
    Integer selectMaxId();
    @Insert("insert into users (id,account,password,username) values(#{id},#{account},#{password},#{username})")
    int insert(Users users);
    Users queryById(Long id);
    @Select("select username from users where id = #{id}")
    String queryUsernameById(Integer id);
}
